import React from 'react'
import { Route, Switch } from 'react-router-dom'
import Loadable from 'react-loadable'

import NotFound from './not-found'

const Homepage = Loadable({
  loader: () => import(/* webpackChunkName: "homepage" */ './homepage'),
  loading: () => null,
  modules: ['homepage']
})

const Login = Loadable({
  loader: () => import(/* webpackChunkName: "login" */ './login'),
  loading: () => null,
  modules: ['login']
})

export default () => (
  <Switch>
    <Route exact path="/" component={Homepage} />
    <Route exact path="/login" component={Login} />
    
    <Route component={NotFound} />
  </Switch>
)
